package com.romotc.qqrobot.bean;

import java.util.Arrays;

import org.apache.commons.lang.StringUtils;

import com.romotc.common.utils.MyStringUtil;
import com.romotc.joyin.bean.Customer;
import com.romotc.joyin.bean.CustomerService;
import com.romotc.oschina.bean.POJO;
import com.romotc.qqrobot.webqq.bean.Send_buddy_msg2_RequestBody;
/**
 * 发送消息对应的数据库对象
 * @author Administrator
 *
 */
public class SendMsg extends POJO {
	private long sendTo;
	private int face;
	private String msgContext_data;
	private String msgContext_font_name;
	private String msgContext_font_size;
	private String msgContext_font_style;
	private String msgContext_font_color;
	
	private int msgId;
	
	/**
	 * 调用腾讯发送消息接口的QQ号码
	 */
	private long senderQQ;
	
	/**
	 * 发送状态 0 未发送；1 已发送
	 */
	private int status;
	public static int Key_Status_Sended = 1;//已发送
	public static int Key_Status_Default = 0;//未发送
	
	/**
	 * 备注
	 */
	private String note;
	
	
	public SendMsg()
	{
		
	}
	
	public SendMsg(Send_buddy_msg2_RequestBody sendMsgBody) {
		this.sendTo = sendMsgBody.getTo();
		
		//查询对应的客户
		Customer customer = CustomerService.qryCustomerById(-this.sendTo);
		//发送消息的QQ号码 便于查询发送
		if(customer != null)
			this.senderQQ = customer.getCustServiceQQ();
		
		this.face = sendMsgBody.getFace();
		this.msgContext_data = sendMsgBody.getMsgContext_data();
		this.msgContext_font_name = sendMsgBody.getMsgContext_font_name();
		this.msgContext_font_size = sendMsgBody.getMsgContext_font_size();
		this.msgContext_font_style = MyStringUtil.join(sendMsgBody.getMsgContext_font_style(),",");
		this.msgContext_font_color = sendMsgBody.getMsgContext_font_color();
		this.msgId = sendMsgBody.getMsgId();
	}
	
	public static void main(String[] args) {
		Send_buddy_msg2_RequestBody body = new Send_buddy_msg2_RequestBody();
		body.setMsgContext_font_style(new int[]{1,2,3,4,5});
		SendMsg msg = new SendMsg(body);
		msg.Save();

	}


	public int getFace() {
		return face;
	}

	public void setFace(int face) {
		this.face = face;
	}

	public String getMsgContext_data() {
		return msgContext_data;
	}

	public void setMsgContext_data(String msgContext_data) {
		this.msgContext_data = msgContext_data;
	}

	public String getMsgContext_font_name() {
		return msgContext_font_name;
	}

	public void setMsgContext_font_name(String msgContext_font_name) {
		this.msgContext_font_name = msgContext_font_name;
	}

	public String getMsgContext_font_size() {
		return msgContext_font_size;
	}

	public void setMsgContext_font_size(String msgContext_font_size) {
		this.msgContext_font_size = msgContext_font_size;
	}


	public long getSendTo() {
		return sendTo;
	}

	public void setSendTo(long sendTo) {
		this.sendTo = sendTo;
	}

	public String getMsgContext_font_style() {
		return msgContext_font_style;
	}

	public void setMsgContext_font_style(String msgContext_font_style) {
		this.msgContext_font_style = msgContext_font_style;
	}

	public String getMsgContext_font_color() {
		return msgContext_font_color;
	}

	public void setMsgContext_font_color(String msgContext_font_color) {
		this.msgContext_font_color = msgContext_font_color;
	}

	public int getMsgId() {
		return msgId;
	}

	public void setMsgId(int msgId) {
		this.msgId = msgId;
	}

	public long getSenderQQ() {
		return senderQQ;
	}

	public void setSenderQQ(long senderQQ) {
		this.senderQQ = senderQQ;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}
}
